package es.ull.etsii.aa.utiles;

public class ParIndice {
	
	private int indice1;
	private int indice2;
	
	public ParIndice (int n1, int n2) {
		this.indice1 = n1;
		this.indice2 = n2;
	}
	
	public int getIndice1() {
		return indice1;
	}
	
	public int getIndice2() {
		return indice2;
	}
	
	@Override
	public boolean equals(Object o) {
		if (o == null)
			return false;
		
		if (o == this)
			return true;
		
		if (!(o instanceof ParIndice))
			return false;
		
		ParIndice par = (ParIndice) o;
		
		if ((indice1 == par.indice1) && (indice2 == par.indice2))
			return true;
		
		return false;
	}
	
	@Override
	public int hashCode() {
		return (indice1 << 0x10 | indice2);
	}
	
	public String toString() {
		StringBuilder sb = new StringBuilder();

		sb.append(this.getClass().getSimpleName());
		sb.append("(" + indice1);
		sb.append(", " + indice2);
		sb.append(")");

		return sb.toString();
	}
}
